package com.example.lucky.draw.user.config;

import com.example.lucky.draw.user.handler.UserLogHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerResponse;

import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
/**
 * 定义用户日志路由器
 * 用于配置请求与处理器的映射关系
 */
@Configuration
public class UserLogRouter {

    @Bean
    public RouterFunction<ServerResponse> routerUserLog(UserLogHandler userLogHandler) {
        return route(GET("/draw/user-log/findAll"),userLogHandler::findAll);
    }
}
